import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

export default new Router({
  // mode: "history",
  routes: [
    {
      path: '/',
      redirect: '/devmanage/databoard'
    },
    {
      path: '/',
      component: () => import('../components/common/Base.vue'),
      meta: {
        title: '公共部分'
      },
      children: [
        {
          path: '/devmanage/databoard',
          component: () => import('../views/devmanage/databoard/index.vue'),
          meta: {
            title: '数据展板'
          },
        },
        {
          path: '/devmanage/devicelist',
          component: () => import('../views/devmanage/devicelist/index.vue'),
          meta: {
            title: '设备列表'
          },
        },
        {
          path: '/devmanage/alertmanager',
          component: () => import('../views/devmanage/alertmanager/index.vue'),
          meta: {
            title: '报警管理'
          },
        },
        {
          path: '/devmanage/calendar',
          component: () => import('../views/devmanage/calendar/index.vue'),
          meta: {
            title: '日历'
          },
        },
        {
          path: '/devmanage/operationlog',
          component: () => import('../views/devmanage/operationlog/index.vue'),
          meta: {
            title: '操作日志'
          },
        },
        {
          path: '/subsystem/systemlinkage',
          component: () => import('../views/subsystem/systemlinkage/index.vue'),
          meta: {
            title: '系统联动'
          },
        },
        {
          path: '/workorder/patrolsystem',
          component: () => import('../views/workorder/patrolsystem/index.vue'),
          meta: {
            title: '巡检系统'
          },
        },
        {
          path: '/workorder/orderlist',
          component: () => import('../views/workorder/orderlist/index.vue'),
          meta: {
            title: '工单管理'
          },
        },
        {
          path: '/lowcarbonplan/datalist',
          component: () => import('../views/lowcarbonplan/datalist/index.vue'),
          meta: {
            title: '能耗数据'
          },
        },
      ]
    },
    {
      path: '/login',
      component: () => import('../components/page/Login.vue')
    },
    {
      path: '/error',
      component: () => import('../components/page/Error.vue')
    },
    {
      path: '/404',
      component: () => import('../components/page/404.vue')
    }
  ]
})
